﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace PhonePcFileTransfer
{
    /// <summary>
    /// HotspotDialog.xaml 的交互逻辑
    /// </summary>
    public partial class HotspotDialog : Window
    {
        public string Ssid { get; private set; }
        public string Password { get; private set; }
        public HotspotDialog()
        {
            InitializeComponent();
        }
        private void CreateBtn_Click(object sender, RoutedEventArgs e)
        {
            Ssid = SsidTextBox.Text.Trim();
            Password = PasswordBox.Password.Trim();

            if (string.IsNullOrEmpty(Ssid))
            {
                MessageBox.Show("请输入热点名称", "提示", MessageBoxButton.OK, MessageBoxImage.Warning);
                return;
            }

            if (string.IsNullOrEmpty(Password) || Password.Length < 8)
            {
                MessageBox.Show("请输入至少8位的密码", "提示", MessageBoxButton.OK, MessageBoxImage.Warning);
                return;
            }

            DialogResult = true;
            Close();
        }

        private void CancelBtn_Click(object sender, RoutedEventArgs e)
        {
            DialogResult = false;
            Close();
        }
    }
}
